package com.roi.model;

import java.util.Date;

public class SavingAccount extends Account {
	private static final long serialVersionUID = -3079060535440188171L;
	private double interestRate;
	private Date interestPayDate;

	public SavingAccount(Customer c) {
		super(c);
		interestRate = 0.0175;
		setInterestPayDate(new Date());
	}

	public void payInterest() {
		balance = balance * (1 + interestRate);
	}

	public String toString() {
		return "Type: Saving Account" + "\nAccount number: "
				+ this.getAccountNumber() + "\nBalance: " + balance;
	}

	public Date getInterestPayDate() {
		return interestPayDate;
	}

	public void setInterestPayDate(Date interestPayDate) {
		this.interestPayDate = interestPayDate;
	}

}
